package org.imast.actions;

import java.util.ArrayList;
import java.util.List;

import org.imast.models.ModelMarket;
import org.imast.services.ServiceMarket;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ActionMarkets extends ActionSupport implements ModelDriven<ModelMarket>{
	
	private ModelMarket market = new ModelMarket();
	private List<ModelMarket> listMarket = new ArrayList<ModelMarket>();
	private ServiceMarket serviceMarket = new ServiceMarket();
	
	public String getAll(){
		
		listMarket = serviceMarket.getAll();
		
		return SUCCESS;
		
	}

	public ModelMarket getMarket() {
		return market;
	}

	public void setMarket(ModelMarket market) {
		this.market = market;
	}

	public List<ModelMarket> getListMarket() {
		return listMarket;
	}

	public void setListMarket(List<ModelMarket> listMarket) {
		this.listMarket = listMarket;
	}

	@Override
	public ModelMarket getModel() {
		// TODO Auto-generated method stub
		return market;
	}

}
